package com.augn.controller;

import com.augn.entity.Address;
import com.augn.entity.GoodsEvaluateFrom;
import com.augn.entity.Result;
import com.augn.entity.Style;
import com.augn.service.IGoodsEvaluateFromService;
import com.augn.service.IStyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Iterator;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author augn
 * @since 2022-09-22
 */
@RestController
@RequestMapping("/style")
public class StyleController {

    @Autowired
    private IStyleService service;

    @PostMapping("/insertOne")
    public Result<?> insertOneStyle(@RequestBody Style style){
        return service.insertOneStyle(style);
    }

    @DeleteMapping("/deleteOne/{id}")
    public Result<?> deleteOneStyle(@PathVariable Integer id){
        return service.deleteOneStyle(id);
    }

    @PutMapping("/updateOne")
    public Result<?> updateOneStyle(@RequestBody Style style){
        return service.updateOneStyle(style);
    }

    @GetMapping("/getOne/{id}")
    public Result<?> getOneStyle(@PathVariable Integer id) {
        return service.getOneStyle(id);
    }

    @GetMapping("/getPart/{id}")
    public Result<?> getPartStyle(@PathVariable Integer id){
        return service.getPartStyle(id);
    }
}
